﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学习会管理系统</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./static/css/font.css">
    <link rel="stylesheet" href="./static/css/weadmin.css">
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
</head>
<body>
    
    <!-- 顶部开始 -->
    <div class="container layui-bg-blue">
        <div class="logo">
            <a href="../manager.html">学习会管理系统</a>
        </div>
        <div class="left_open">
            <i title="展开左侧栏" class="iconfont">&#xe699;</i>
        </div>
        <div>
            <ul class="layui-nav left fast-add" id="navtopA"></ul>
        </div>
        <ul class="layui-nav right" lay-filter="">
            <li class="layui-nav-item">
                <a href="javascript:;" id="EmpID"></a>
                <dl class="layui-nav-child">
                    <!-- 二级菜单 -->
                    <!--<dd>
                        <a href="#" onclick="WeAdminShow('个人信息','http://www.baidu.com')">个人信息</a>
                    </dd>-->
                    <dd>
                        <a class="loginout" href="login.html">退出</a>
                    </dd>
                </dl>
            </li>
            <!--<li class="layui-nav-item to-index">
                <a href="/">前台首页</a>
            </li>-->
        </ul>
    </div>
    <!-- 顶部结束 -->
    <!-- 中部开始 -->
    <!-- 左侧菜单开始 -->
    <div class="left-nav" style="left:-221px;">
        <div id="side-nav">
            <ul id="nav"></ul>
        </div>
    </div>
    <!-- <div class="x-slide_left"></div> -->
    <!-- 左侧菜单结束 -->
    <!-- 右侧主体开始 -->
    <div class="page-content" style="left:0px;">
        <div class="layui-tab tab" lay-filter="wenav_tab" id="WeTabTip" lay-allowclose="true">
            <!--<ul class="layui-tab-title" id="tabName">
                <li>我的桌面</li>
            </ul>-->
            <div class="layui-tab-content" style="top:0;">
                <div class="layui-tab-item layui-show">
                    <iframe src="./views/home.html" frameborder="0" class="weIframe" id="frameContainer"></iframe>
                </div>
            </div>
        </div>
    </div>
    <div class="page-content-bg"></div>
    <!-- 右侧主体结束 -->
    <!-- 中部结束 -->
    <!-- 底部开始 -->
    <div class="footer">
        <div class="copyright">Copyright ©2019 郑州爱普锐 All Rights Reserved</div>
    </div>
    <!-- 底部结束 -->
    <script type="text/javascript">
        layui.config({
            base: './static/js/'
        }).use('admin');
        layui.use(['jquery', 'admin'], function () {
            var $ = layui.jquery;
            $("#EmpID").text(JSON.parse(window.localStorage.getItem("authInfo")).UserName);
            //页面加载后，获取菜单信息
            $.ajax({
                url: ApiUrl + "GetModule",
                //url: "http://172.16.1.27:8899/api/GetModule",
                type: 'POST',
                cache: false,
                headers: {
                    "userid": JSON.parse(window.localStorage.getItem("authInfo")).UserId,
                    "signtoken": JSON.parse(window.localStorage.getItem("authInfo")).SignToken,
                },
                success: function (data) {
                    if (data.StatusCode == 200) {
                        $(data.Data).each(function (index, item) {
                            var htmlmenu = "";
                            if (item.ModParentID == 0) {
                                htmlmenu += '<li id="menu_' + item.ModID + '">';
                                htmlmenu += '<a href="javascript:;"><i class="iconfont">&#xe6b8;</i><cite>' + item.ModName + '</cite><i class="iconfont nav_right">&#xe697;</i></a>';
                                htmlmenu += '<ul class="sub-menu"></ul>'
                                htmlmenu += "</li>";
                                $("#nav").append(htmlmenu);
                            }
                            else {
                                htmlmenu += '<li><a _href="/views' + item.ModUrl + '"><i class="iconfont">&#xe6a7;</i><cite>' + item.ModName + '</cite></a></li>';
                                $("#menu_" + item.ModParentID + " .sub-menu").append(htmlmenu);
                            }
                        });
                        var htmlmenuall = "";
                        $("#navtopA").find('span.layui-nav-bar').remove();
                        $(data.Data).each(function (index, item) {
                            var htmlmenu = "";
                            if (item.ModParentID == 0) {
                                htmlmenu += '<li id="navtop_' + item.ModID + '" class="layui-nav-item" >';
                                htmlmenu += '<a href="javascript:;">' + item.ModName + '</a>';
                                htmlmenu += '<ul class="layui-nav-child">';
                                htmlmenu += "</ul></li>";
                                $("#navtopA").append(htmlmenu);
                                htmlmenuall += htmlmenu;
                            }
                            else {
                                htmlmenu += '<li><a _href="/views' + item.ModUrl + '"><cite>' + item.ModName + '</cite></a></li>';
                                $("#navtop_" + item.ModParentID + " .layui-nav-child").append(htmlmenu);
                            }
                        });
                        Getstyle();
                    }
                    else if (data.StatusCode == 403) {
                        top.layer.alert(data.Info + ",请重新登录！", { closeBtn: 0 }, function () {
                            top.location.href = "http://" + top.location.host + "/login.html";
                        })
                    }
                    else {
                        layer.msg(data.Info);
                    }
                }
            });

            function Getstyle() {
                layui.use('element', function () {
                    var element = layui.element;
                    var layFilter = $("#navtopA").attr('lay-filter');
                    element.render('navtopA', layFilter);
                })
            }
            function gethtml(data, pid) {
                var htmlmenuhead = '<ul class="layui-nav-child">';
                var htmlmenutail = '</ul>';
                var htmlmenu = '';
                for (var i = 0; i < data.Data.length; i++) {
                    if (data.Data[i].ModParentID == pid) {
                        htmlmenu += '<li><a _href="/views' + data.Data[i].ModUrl + '"><cite>' + data.Data[i].ModName + '</cite></a></li>';
                    }
                }
                if (htmlmenu != '') htmlmenu = htmlmenuhead + htmlmenu + htmlmenutail;
                return htmlmenu;
            };
            //获取权限按钮
            $.ajax({
                url: ApiUrl + "/GetPowerList",//
                type: 'post',
                headers: {
                    "userid": JSON.parse(window.localStorage.authInfo).UserId,
                    "signtoken": JSON.parse(window.localStorage.authInfo).SignToken,
                },
                success: function (data) {
                    if (data.StatusCode == 200) {
                        LoginPower(data.Data);
                    }
                    else if (data.StatusCode == 403) {
                        layer.alert(data.Info, function () {
                            location.href = './login.html';
                        })
                    }
                    else {
                        layer.msg(data.Info);
                    }
                }
            });

        });
    </script>
</body>
<!--Tab菜单右键弹出菜单-->
<!--<ul class="rightMenu" id="rightMenu">
    <li data-type="fresh">刷新</li>
    <li data-type="current">关闭当前</li>
    <li data-type="other">关闭其它</li>
    <li data-type="all">关闭所有</li>
</ul>-->
</html>